<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>WebRTC Camera Access</title>
</head>
<body>
    <video id="video" autoplay playsinline muted></video>
    <button id="startCamera">Start Camera</button>
    <script>
        const video = document.getElementById('video');
        const startCameraButton = document.getElementById('startCamera');

        startCameraButton.addEventListener('click', async () => {
            try {
                const stream = await navigator.mediaDevices.getUserMedia({ video: true });
                video.srcObject = stream;
                video.play();
            } catch (error) {
                console.error('Error accessing camera:', error);
            }
        });
    </script>
</body>
</html>